package com.naizhuai.ui.entity.mainbusiness;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import com.naizhuai.ui.entity.ImageBean;

import java.io.Serializable;

/**
 * 修改的改前改后的图片的bean
 * Created by code_han on 2018/3/30.
 */

public class CompareImageBean implements Serializable {

    private String imgId;
    private ImageBean beforeImage;
    private ImageBean afterImage;
    @SerializedName("mImage")
    private ImageBean mergeImage;

    public CompareImageBean() {
    }

    public String getImgId() {
        return imgId;
    }

    public void setImgId(String imgId) {
        this.imgId = imgId;
    }

    public ImageBean getBeforeImage() {
        return beforeImage;
    }

    public void setBeforeImage(ImageBean beforeImage) {
        this.beforeImage = beforeImage;
    }

    public ImageBean getAfterImage() {
        return afterImage;
    }

    public void setAfterImage(ImageBean afterImage) {
        this.afterImage = afterImage;
    }

    public ImageBean getMergeImage() {
        return mergeImage;
    }

    public void setMergeImage(ImageBean mergeImage) {
        this.mergeImage = mergeImage;
    }

    public String getMergeImageUrl() {
        if (mergeImage!=null&&!TextUtils.isEmpty(mergeImage.getUrl()))
            return mergeImage.getUrl();
        if (afterImage!=null&&!TextUtils.isEmpty(afterImage.getUrl()))
            return afterImage.getUrl();
        else
            return beforeImage.getUrl();
    }

    @Override
    public String toString() {
        String before = beforeImage == null ? "为空" : beforeImage.toString();
        String after = afterImage == null ? "为空" : afterImage.toString();
        return "imgId=" + imgId + ";beforeImage=" + before + ";afterImage=" + after;
    }
}
